import "@/assets/main.scss";

import { createApp } from "vue";
import { createPinia } from "pinia";
// import { useUserStore } from "@/stores/useUserStore";

import App from "@/App.vue";
import router from "@/router";
import ElementPlus from "element-plus";
import "element-plus/dist/index.css";
import zhCn from "element-plus/dist/locale/zh-cn.mjs";

const app = createApp(App);

// 全局前置守卫
// const userStore = useUserStore(createPinia());
// router.beforeEach(function (to, from, next) {
//   const token = localStorage.getItem("token");
//   if (token || userStore.token) {
//     next();
//   } else {
//     next("/login");
//   }
// });

app.use(createPinia()).use(router).use(ElementPlus, { locale: zhCn });

app.mount("#app");
